<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="h" uri="/syzg-html"%>
<%@ taglib prefix="security" uri="http://www.enersun.com.cn/security"%>

<!DOCTYPE html>
<html>
	<head>
		<%@ include file="/base/jsp/common/CommonListTop.jsp"%>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>[App管理-列表]</title>
		<link href="${ctx}/base/css/base.css" rel="stylesheet" type="text/css" />
		<link href="${ctx}/base/css/common.css" rel="stylesheet" type="text/css" />
		<link href="${ctx}/base/css/${customTheme}.css" rel="stylesheet" type="text/css" />
		<script src="${ctx}/base/js/base.js" type="text/javascript"></script>
		<script src="${ctx}/base/js/common/FormFunction.js" type="text/javascript"></script>
		<script src="${ctx}/baseNew/plugins/jQuery/jQuery-2.2.0.min.js"></script>
		<link href="${ctx}/baseNew/bootstrap/css/bootstrap.min.css" rel="stylesheet">
		<script src="${ctx}/baseNew/bootstrap/js/bootstrap.js" type="text/javascript"></script>
    	<link href="${ctx}/baseNew/other/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
		<script src="${ctx}/baseNew/other/js/bootstrap-datetimepicker.js" type="text/javascript"></script>
		<script src="${ctx}/baseNew/other/js/locales/bootstrap-datetimepicker.zh-CN.js" type="text/javascript"></script>
		<link rel="stylesheet" href="${ctx}/baseNew/dist/css/AdminLTE.min.css">
  		<link rel="stylesheet" href="${ctx}/baseNew/dist/css/skins/_all-skins.min.css">
  		<script src="${ctx}/baseNew/other/js/bootbox.min.js" type="text/javascript"></script>
  		<link rel="stylesheet" href="${ctx}/baseNew/validator/css/bootstrapValidator.css"/>
		<script type="text/javascript" src="${ctx}/baseNew/validator/js/bootstrapValidator.js"></script>
		<link rel="stylesheet" href="${ctx}/zenithsun/css/admin-imgList.css"/>
		<!-- 公用的按钮函数 -->
		<script>
			var editUrl = "${ctx}/path/basicdata/initversion";//表单列表edit 的url地址
			var saveAddUrl = "${ctx}/path/basicdata/addbasicdata";//表单列表save的url地址
			var saveEditUrl = "${ctx}/path/basicdata/modbasicdata";//表单列表save的url地址
 
			function defaultEvent(eventType,width,height) {
				FormFunction.defaultEvent(eventType,width,height);//默认的处理函数，需自定义时自己写 在PublicFunction.js里
			}
		</script>
	</head>

	<body class="rightBody">
		<form name="searchForm" method="post" action="" class="form-inline">
		 <security:CSRF/>
			<table width="100%" class="title" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<th>
				    	<img src="${ctx}/zenithsun/images/back.png" width="26" height="26" alt="图标 " class="icon" />
						<em class="headTips">系统管理</em> &gt; App管理
					</th>
					<th width="200"></th>
				</tr>
				<tr>
					<td align="right" colspan="2">
						<input type="text" name="website" id="website" class="form-control input-sm" style="width: 400px;" placeholder="网站地址..."/>
						<input type="button" class="btn btn-primary" value="生成二维码" onclick="createQRCode()" />
					</td>
				</tr>
			</table>
			<h:table cssClass="table table-bordered table-hover table-striped" cssStyle="margin-bottom:-5px;" value="listBasicdata">
                <h:column headerTitle="App类型" width="20%">
                    ${o.code}
                </h:column>

                <h:column headerTitle="版本号" width="20%">
                    ${o.comment}
                </h:column>
				
				<h:column headerTitle="下载地址" width="50%">
                    <a href="${o.remark}">${o.remark}</a>
                </h:column>
                <h:column headerTitle="操作" width="10%" align="center">
					<a href="javascript:FormFunction.showEditModal('${o.id }');" class="linkorange">重新上传</a>
				</h:column>
			</h:table>
		</form>
		<div id="myDlg"></div>
		<%@ include file="/base/jsp/common/CommonListFoot.jsp"%>
	</body>
	<script>
	/**
	 * 去除字符串首尾空格
	*/
	String.prototype.trim=function(){
	   return this.replace(/(^\s*)|(\s*$)/g, "");
	};
	/**
	* 创建二维码
	*/
	function createQRCode(){
		var websiteValue=$("#website").val();
		if(websiteValue.trim().length>0){
			$.post("${ctx}/path/basicdata/buildQRCode",{"website":websiteValue},function(result){
				if(result.state=='Success'){
					bootbox.alert("<h4>"+result.content+"</h4>", function(){});
				} else {
					bootbox.alert("<h4>操作失败,原因：" + result.content + "</h4>", function(){});
				}
			});
		}else{
			bootbox.alert("<h4>请填写网站地址！</h4>", function(){});
		}
	}
	</script>
</html>